<?php
/*------------------------------------------------------------------------
# edit.php - tour Component
# ------------------------------------------------------------------------
# author    khuon sokkhim
# copyright Copyright (C) 2014. All Rights Reserved
# license   GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# website   www.sysokleng.com
-------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$params = $this->form->getFieldsets('params');
$componentParams = JComponentHelper::getParams('com_tour');

?>
<style type="text/css">
	.full, .thumb { border: 1px solid #CCC; float: left; margin: 0 10px 0 0; padding: 10px; }
	.full h2, .thumb h2 { margin: 0; padding: 0; }
</style>
<ul class="nav nav-tabs hidden" >
	<li class="active"><a data-toggle="tab" href="#home">tab</a></li>
</ul>
<form action="<?php echo JRoute::_('index.php?option=com_tour&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
	<div class="row-fluid">
		<div class="span12 form-horizontal">
                         <?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'general')); ?>
                    <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'general', JText::_('General', true)); ?>
			<fieldset class="adminform">
                           
       
				<legend><?php echo JText::_( 'General' ); ?></legend>
				<div class="adminformlist">
					<?php foreach($this->form->getFieldset('details') as $field){ ?>
						 
                                                <div>
							<?php echo $field->label; echo $field->input;?>
							<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
							<label>Delete Image</label><input type="checkbox" name="tourimage_delete" value="1" />
							<div class="clearfix"></div>
							<?php } ?>
						</div>
                                                 
                           
						<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
						<label>Image Preview</label>
						<div class="full">
							<h2>Full Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/' . $field->value; ?>" />
						</div>
						<div class="thumb">
							<h2>Thumb Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/thumb/' . $field->value; ?>" />
						</div>
						<?php } ?>
                      
						<div class="clearfix"></div>
					<?php }; ?>
                                                
				</div>
			</fieldset>
                     <?php echo JHtml::_('bootstrap.endTab'); ?>
                    <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'images', JText::_('Images', true)); ?>
			<fieldset class="adminform">
                           
       
				<legend><?php echo JText::_( 'Images' ); ?></legend>
				<div class="adminformlist">
					<?php foreach($this->form->getFieldset('images') as $field){ ?>
						 
                                                <div>
							<?php echo $field->label; echo $field->input;?>
							<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
							<label>Delete Image</label><input type="checkbox" name="tourimage_delete" value="1" />
							<div class="clearfix"></div>
							<?php } ?>
						</div>
                                                 
                           
						<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
						<label>Image Preview</label>
						<div class="full">
							<h2>Full Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/' . $field->value; ?>" />
						</div>
						<div class="thumb">
							<h2>Thumb Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/thumb/' . $field->value; ?>" />
						</div>
						<?php } ?>
                      
						<div class="clearfix"></div>
					<?php }; ?>
                                                
				</div>
			</fieldset>
                     <?php echo JHtml::_('bootstrap.endTab'); ?>
                     <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'tourbrief', JText::_('Tour Brief', true)); ?>
			<fieldset class="adminform">
                           
       
				<legend><?php echo JText::_( 'Tour Brief' ); ?></legend>
				<div class="adminformlist">
					<?php foreach($this->form->getFieldset('tourbrief') as $field){ ?>
						 
                                                <div>
							<?php echo $field->label; echo $field->input;?>
							<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
							<label>Delete Image</label><input type="checkbox" name="tourimage_delete" value="1" />
							<div class="clearfix"></div>
							<?php } ?>
						</div>
                                                 
                           
						<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
						<label>Image Preview</label>
						<div class="full">
							<h2>Full Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/' . $field->value; ?>" />
						</div>
						<div class="thumb">
							<h2>Thumb Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/thumb/' . $field->value; ?>" />
						</div>
						<?php } ?>
                      
						<div class="clearfix"></div>
					<?php }; ?>
                                                
				</div>
			</fieldset>
                     <?php echo JHtml::_('bootstrap.endTab'); ?>
                     <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'tourdetail', JText::_('Tour Detail', true)); ?>
			<fieldset class="adminform">
                           
       
				<legend><?php echo JText::_( 'Tour Detail' ); ?></legend>
				<div class="adminformlist">
					<?php foreach($this->form->getFieldset('tourdetail') as $field){ ?>
						 
                                                <div>
							<?php echo $field->label; echo $field->input;?>
							<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
							<label>Delete Image</label><input type="checkbox" name="tourimage_delete" value="1" />
							<div class="clearfix"></div>
							<?php } ?>
						</div>
                                                 
                           
						<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
						<label>Image Preview</label>
						<div class="full">
							<h2>Full Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/' . $field->value; ?>" />
						</div>
						<div class="thumb">
							<h2>Thumb Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/thumb/' . $field->value; ?>" />
						</div>
						<?php } ?>
                      
						<div class="clearfix"></div>
					<?php }; ?>
                                                
				</div>
			</fieldset>
                     <?php echo JHtml::_('bootstrap.endTab'); ?>
                    <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'tourwaitin', JText::_('Tour wait in', true)); ?>
			<fieldset class="adminform">
                           
       
				<legend><?php echo JText::_( 'Tour wait in' ); ?></legend>
				<div class="adminformlist">
					<?php foreach($this->form->getFieldset('tourwaitin') as $field){ ?>
						 
                                                <div>
							<?php echo $field->label; echo $field->input;?>
							<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
							<label>Delete Image</label><input type="checkbox" name="tourimage_delete" value="1" />
							<div class="clearfix"></div>
							<?php } ?>
						</div>
                                                 
                           
						<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
						<label>Image Preview</label>
						<div class="full">
							<h2>Full Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/' . $field->value; ?>" />
						</div>
						<div class="thumb">
							<h2>Thumb Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/thumb/' . $field->value; ?>" />
						</div>
						<?php } ?>
                      
						<div class="clearfix"></div>
					<?php }; ?>
                                                
				</div>
			</fieldset>
                     <?php echo JHtml::_('bootstrap.endTab'); ?>
                    <?php echo JHtml::_('bootstrap.addTab', 'myTab', 'tourcategories', JText::_('Categories Tours', true)); ?>
			<fieldset class="adminform">
                           
       
				<legend><?php echo JText::_( 'Categories Tours' ); ?></legend>
				<div class="adminformlist">
					<?php foreach($this->form->getFieldset('tourcategories') as $field){ ?>
						 
                                                <div>
							<?php echo $field->label; echo $field->input;?>
							<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
							<label>Delete Image</label><input type="checkbox" name="tourimage_delete" value="1" />
							<div class="clearfix"></div>
							<?php } ?>
						</div>
                                                 
                           
						<?php if($field->fieldname == 'tourimage' && $field->value){ ?>
						<label>Image Preview</label>
						<div class="full">
							<h2>Full Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/' . $field->value; ?>" />
						</div>
						<div class="thumb">
							<h2>Thumb Image</h2>
							<img src="<?php echo JURI::root(false) . 'images/com_tour/thumb/' . $field->value; ?>" />
						</div>
						<?php } ?>
                      
						<div class="clearfix"></div>
					<?php }; ?>
                                                
				</div>
			</fieldset>
                     <?php echo JHtml::_('bootstrap.endTab'); ?>
		</div>
	</div>
	<div>
		<input type="hidden" name="task" value="tourdetail.edit" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</form>